<!-- DataGovernanceProcess.vue -->
<template>
  <div class="data-governance-process">
    <div class="process-header">
      <h1 class="process-title">电磁数据处理过程追踪</h1>
      <div class="process-controls">
        <el-select v-model="pipelineId" size="small" placeholder="选择流水线">
          <el-option
              v-for="item in pipelines"
              :key="item.id"
              :label="item.name"
              :value="item.id"
          />
        </el-select>
        <el-date-picker
            v-model="dateRange"
            type="datetimerange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            size="small"
        />
        <el-button type="primary" size="small" @click="refreshData">
          <el-icon><Refresh /></el-icon>
          刷新
        </el-button>
      </div>
    </div>

    <div class="process-dashboard">
      <CleaningPipelineGantt />
      <IntermediateDataLogViewer />
    </div>

    <div class="process-footer">
      <div class="status-indicator">
        <el-icon><CircleCheckFilled /></el-icon>
        <span>当前状态: <span class="status-running">运行中</span></span>
      </div>
      <div class="execution-info">
        已处理数据: <span class="highlight">1.24M</span> |
        异常记录: <span class="highlight-error">346</span> |
        平均耗时: <span class="highlight">42ms</span>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { Refresh, CircleCheckFilled } from '@element-plus/icons-vue'
import CleaningPipelineGantt from './process/CleaningPipelineGantt.vue'
import IntermediateDataLogViewer from './process/IntermediateDataLogViewer.vue'
import {ElButton, ElDatePicker, ElIcon, ElOption, ElSelect} from "element-plus";

const pipelineId = ref('pipeline-001')
const pipelines = ref([
  { id: 'pipeline-001', name: '雷达信号清洗流水线' },
  { id: 'pipeline-002', name: '频谱数据清洗流水线' },
  { id: 'pipeline-003', name: '卫星数据清洗流水线' }
])

const dateRange = ref([new Date(2025, 7, 1), new Date(2025, 7, 5)])

const refreshData = () => {
  console.log('刷新数据...')
}
</script>

<style scoped>
.data-governance-process {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 93vw;
  background: linear-gradient(135deg, #0c1124 0%, #1a2444 100%);
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  color: #e4f0ff;
  overflow: hidden;
  padding: 1.5vh 2vw;
}

.process-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2vh;
  padding-bottom: 1.5vh;
  border-bottom: 1px solid rgba(75, 130, 230, 0.3);
}

.process-title {
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  background: linear-gradient(to right, #4db8ff, #9c42ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(126, 87, 194, 0.4);
  margin: 0;
}

.process-controls {
  display: flex;
  align-items: center;
  gap: 1vw;
}

.process-dashboard {
  display: flex;
  flex: 1;
  gap: 1.5vw;
  height: calc(100% - 15vh);
}

.process-dashboard > * {
  flex: 1;
  background: rgba(16, 22, 46, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(64, 140, 246, 0.25);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(2, 8, 24, 0.4);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.process-dashboard > *:hover {
  box-shadow: 0 8px 40px rgba(64, 140, 246, 0.3);
}

.process-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5vh;
  padding-top: 1.5vh;
  border-top: 1px solid rgba(75, 130, 230, 0.3);
  font-size: 0.9rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5vw;
}

.status-indicator .el-icon {
  color: #2ecc71;
}

.status-running {
  color: #2ecc71;
  font-weight: 500;
}

.execution-info {
  color: #a0bff0;
}

.highlight {
  color: #4db8ff;
  font-weight: 500;
}

.highlight-error {
  color: #ff6b6b;
  font-weight: 500;
}
</style>